package com.giantlizard.cloud.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.giantlizard.cloud.base.utils.ConversionUtil;
import com.giantlizard.cloud.base.utils.TreeUtils;
import com.giantlizard.cloud.system.entity.SysRes;
import com.giantlizard.cloud.system.mapper.SysResMapper;
import com.giantlizard.cloud.system.service.SysResService;
import com.giantlizard.cloud.system.vo.SysResVo;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 系统-资源 服务实现类
 */
@Service
public class SysResServiceImpl extends ServiceImpl<SysResMapper, SysRes> implements SysResService {
    @Override
    public List<SysResVo> tree() {
        List<SysRes> list = this.list();
        List<SysResVo> resList = ConversionUtil.convertToVoList(list, SysResVo.class);
        return TreeUtils.buildTree(resList, "0","orderNo",true);
    }
}